<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "task".
 *
 * @property integer $id
 * @property string $type
 * @property integer $priority
 * @property string $key
 * @property string $from_system
 * @property string $request_data
 * @property string $response_data
 * @property string $memo
 * @property integer $is_synchronization
 * @property integer $status
 * @property string $next_run_date
 * @property integer $suspend_times
 * @property integer $retry_times
 * @property string $started_at
 * @property string $stopped_at
 * @property integer $total_number
 * @property integer $finished_number
 * @property string $finish_rate
 * @property string $created_by
 * @property string $created_at
 * @property string $updated_by
 * @property string $updated_at
 */
class Task extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'task';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['priority', 'is_synchronization', 'status', 'suspend_times', 'retry_times', 'total_number', 'finished_number'], 'integer'],
            [['next_run_date', 'started_at', 'stopped_at', 'created_at', 'updated_at'], 'safe'],
            [['type', 'created_by', 'updated_by'], 'string', 'max' => 45],
            [['key', 'from_system', 'finish_rate'], 'string', 'max' => 255],
            [['request_data', 'response_data', 'memo'], 'string', 'max' => 4096],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'type' => Yii::t('app', 'Type'),
            'priority' => Yii::t('app', 'Priority'),
            'key' => Yii::t('app', 'Key'),
            'from_system' => Yii::t('app', 'From System'),
            'request_data' => Yii::t('app', 'Request Data'),
            'response_data' => Yii::t('app', 'Response Data'),
            'memo' => Yii::t('app', 'Memo'),
            'is_synchronization' => Yii::t('app', 'Is Synchronization'),
            'status' => Yii::t('app', 'Status'),
            'next_run_date' => Yii::t('app', 'Next Run Date'),
            'suspend_times' => Yii::t('app', 'Suspend Times'),
            'retry_times' => Yii::t('app', 'Retry Times'),
            'started_at' => Yii::t('app', 'Started At'),
            'stopped_at' => Yii::t('app', 'Stopped At'),
            'total_number' => Yii::t('app', 'Total Number'),
            'finished_number' => Yii::t('app', 'Finished Number'),
            'finish_rate' => Yii::t('app', 'Finish Rate'),
            'created_by' => Yii::t('app', 'Created By'),
            'created_at' => Yii::t('app', 'Created At'),
            'updated_by' => Yii::t('app', 'Updated By'),
            'updated_at' => Yii::t('app', 'Updated At'),
        ];
    }
}
